﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="logueo_usuario.aspx.cs" Inherits="logueo_usuario" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style1
        {
            width: 475px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    
       <h1>Iniciar sesión en SAFA</h1>
<br />
<table style="width:100%;">
    <tr>
        <td>
      Ingrese Nombre de Usuario
 
            <br />
<asp:TextBox ID="TextBox1" runat="server" Height="20px" Width="203px" 
                CausesValidation="True"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                ControlToValidate="TextBox1" ErrorMessage="Ingrese un usuario" 
                ForeColor="Red"></asp:RequiredFieldValidator>
        </td>
        <td class="style1">
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
Contraseña</td>
        <td class="style1">
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
<asp:TextBox ID="TextBox2" runat="server" Height="24px" Width="202px" TextMode="Password" 
                CausesValidation="True" ClientIDMode="AutoID"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                ControlToValidate="TextBox2" ErrorMessage="Ingrese una contraseña" 
                ForeColor="#CC0000"></asp:RequiredFieldValidator>
        </td>
        <td class="style1">
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
            &nbsp;</td>
        <td class="style1">
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
<asp:Button ID="Button1" runat="server" Height="32px" Text="Ingresar" 
    Width="200px" onclick="Button1_Click" />
            <br />
            <br />
            <asp:Label ID="Label2" runat="server" ForeColor="#CC3300" Font-Bold="True"></asp:Label>
            <br />
            <br />
        </td>
        <td class="style1">
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:BD_SAFA_FINALConnectionString1 %>" 
                DeleteCommand="DELETE FROM [T_Login] WHERE [id_usr] = @id_usr" 
                InsertCommand="INSERT INTO [T_Login] ([nombre], [pass], [tipo_cuenta]) VALUES (@nombre, @pass, @tipo_cuenta)" 
                ProviderName="<%$ ConnectionStrings:BD_SAFA_FINALConnectionString1.ProviderName %>" 
                SelectCommand="SELECT [id_usr], [nombre], [pass], [tipo_cuenta] FROM [T_Login]" 
                UpdateCommand="UPDATE [T_Login] SET [nombre] = @nombre, [pass] = @pass, [tipo_cuenta] = @tipo_cuenta WHERE [id_usr] = @id_usr">
                <DeleteParameters>
                    <asp:Parameter Name="id_usr" Type="Int32" />
                </DeleteParameters>
                <InsertParameters>
                    <asp:Parameter Name="nombre" Type="String" />
                    <asp:Parameter Name="pass" Type="String" />
                    <asp:Parameter Name="tipo_cuenta" Type="String" />
                </InsertParameters>
                <UpdateParameters>
                    <asp:Parameter Name="nombre" Type="String" />
                    <asp:Parameter Name="pass" Type="String" />
                    <asp:Parameter Name="tipo_cuenta" Type="String" />
                    <asp:Parameter Name="id_usr" Type="Int32" />
                </UpdateParameters>
            </asp:SqlDataSource>
            <br />
        </td>
        <td class="style1">
            <br />
            <br />
        </td>
        <td>
            &nbsp;</td>
    </tr>
</table>
<br />
 
</asp:Content>

